Event-restricted credentials for resource allocation

ABSTRACT

A customer of a resource allocation service can register a function to be executed using virtual resources, where the function includes customer code to be executed. Customer events are defined as triggers for a registered function, and a resource instance is allocated to execute the registered function when triggering event is detected. An identity role associated with the triggering function is used to obtain access credentials for any data source which a triggering event might require for processing. An event-specific access credential is generated that provides a subset of these access privileges using a template policy for the registered function that is filled with values specific to the triggering event. The filled template policy and base credential are used to generate an event-specific credential valid only for access needed for the event. This event-specific credential can be passed with the event data for processing by an allocated instance.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application claims the benefit or priority and is a divisional ofallowed U.S. application Ser. No. 15/382,054, filed Dec. 16, 2016,entitled “EVENT-RESTRICTED CREDENTIALS FOR RESOURCE ALLOCATION,” thedisclosure of this application is incorporated by reference in itsentirety herein for all intents and purposes.

BACKGROUND

Users are increasingly performing tasks using remote computingresources, which may be offered through a shared-resource environment.This has many advantages, as users do not have to purchase and maintaindedicated hardware and software, and instead can pay for only thoseresources that are utilized at any given time, where those resourcestypically will be managed by a resource provider. Users can performtasks such as storing data or executing applications using various typesof resources offered by the resource provider. In some environmentsresources can be allocated on a task-specific basis. In order to enablethe resources to be able to process the relevant tasks, those resourcescan be provided with access credentials for any data sources that mightbe required. In many instances only a subset of this access will berelevant for any given task, such that access granted under thecredential will provide access to more data than is needed. This canpresent a security vulnerability in that a compromised resource can haveaccess to other data in the environment.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments in accordance with the present disclosure will bedescribed with reference to the drawings, in which:

FIG. 1 illustrates an example environment in which various embodimentscan be implemented.

FIG. 2 illustrates an example resource environment for providingtask-based resource allocation that can be used in accordance withvarious embodiments.

FIG. 3 illustrates an example resource fleet that can be utilized inaccordance with various embodiments.

FIG. 4 illustrates an example process for allocating resources forregistered functions that can be utilized in accordance with variousembodiments.

FIG. 5 illustrates an example process for generating event-specificcredentials for a registered function that can be utilized in accordancewith various embodiments.

FIG. 6 illustrates example components of a computing device that can beused to implement aspects of the various embodiments.

DETAILED DESCRIPTION

In the following description, various embodiments will be described. Forpurposes of explanation, specific configurations and details are setforth in order to provide a thorough understanding of the embodiments.However, it will also be apparent to one skilled in the art that theembodiments may be practiced without the specific details. Furthermore,well-known features may be omitted or simplified in order not to obscurethe embodiment being described.

Approaches in accordance with various embodiments provide for thegeneration of event-specific credentials for use in processing customerevents using a set of virtual resources. In various embodiments acustomer can register a function to be executed using the virtualresources, where the function includes customer code to be executed. Thecustomer can also define customer events that serve as triggers for aregistered function. When a triggering function is detected, a virtualresource instance can be allocated to execute the registered function toprocess the triggering event. An identity role can be associated withthe triggering function, which can be used to obtain access credentialsto any data source that a triggering event might require for processing.In order to restrict the sources accessible for a specific event,however, an event-specific access credential or token can be generatedthat provides a subset of the access privileges of the base credential.A template policy specified for the registered function can be filledwith values specific to the triggering function. These values canspecify, for example, the sources of data to which to grant access. Thefilled template policy and base credential can be used to generate anevent-specific credential that is valid only for the specific sourcesfor a determined period of time. This event-specific credential can bepassed with the event data for processing by an allocated instance. Anunintended party coming into possession of the event-specific credentialwill not be able to gain access to other data sources to which accesswould otherwise have been granted under the base credential.

Various other functions can be implemented within the variousembodiments as well as discussed and suggested elsewhere herein.

FIG. 1 illustrates an example environment 100 in which aspects of thevarious embodiments can be implemented. In this example a user is ableto utilize a client device 102 to submit requests across at least onenetwork 104 to a multi-tenant resource provider environment 106. Theclient device can include any appropriate electronic device operable tosend and receive requests, messages, or other such information over anappropriate network and convey information back to a user of the device.Examples of such client devices include personal computers, tabletcomputers, smart phones, notebook computers, and the like. The at leastone network 104 can include any appropriate network, including anintranet, the Internet, a cellular network, a local area network (LAN),or any other such network or combination, and communication over thenetwork can be enabled via wired and/or wireless connections. Theresource provider environment 106 can include any appropriate componentsfor receiving requests and returning information or performing actionsin response to those requests. As an example, the provider environmentmight include Web servers and/or application servers for receiving andprocessing requests, then returning data, Web pages, video, audio, orother such content or information in response to the request.

In various embodiments, the provider environment may include varioustypes of resources that can be utilized by multiple users for a varietyof different purposes. As used herein, computing and other electronicresources utilized in a network environment can be referred to as“network resources.” These can include, for example, servers, databases,load balancers, routers, and the like, which can perform tasks such asto receive, transmit, and/or process data and/or executableinstructions. In at least some embodiments, all or a portion of a givenresource or set of resources might be allocated to a particular user orallocated for a particular task, for at least a determined period oftime. The sharing of these multi-tenant resources from a providerenvironment is often referred to as resource sharing, Web services, or“cloud computing,” among other such terms and depending upon thespecific environment and/or implementation. In this example the providerenvironment includes a plurality of resources 114 of one or more types.These types can include, for example, application servers operable toprocess instructions provided by a user or database servers operable toprocess data stored in one or more data stores 116 in response to a userrequest. As known for such purposes, the user can also reserve at leasta portion of the data storage in a given data store. Methods forenabling a user to reserve various resources and resource instances arewell known in the art, such that detailed description of the entireprocess, and explanation of all possible components, will not bediscussed in detail herein.

In at least some embodiments, a user wanting to utilize a portion of theresources 114 can submit a request that is received to an interfacelayer 108 of the provider environment 106. The interface layer caninclude application programming interfaces (APIs) or other exposedinterfaces enabling a user to submit requests to the providerenvironment. The interface layer 108 in this example can also includeother components as well, such as at least one Web server, routingcomponents, load balancers, and the like. When a request to provision aresource is received to the interface layer 108, information for therequest can be directed to a resource manager 110 or other such system,service, or component configured to manage user accounts andinformation, resource provisioning and usage, and other such aspects. Aresource manager 110 receiving the request can perform tasks such as toauthenticate an identity of the user submitting the request, as well asto determine whether that user has an existing account with the resourceprovider, where the account data may be stored in at least one datastore 112 in the provider environment. A user can provide any of varioustypes of credentials in order to authenticate an identity of the user tothe provider. These credentials can include, for example, a username andpassword pair, biometric data, a digital signature, or other suchinformation. The provider can validate this information againstinformation stored for the user. If the user has an account with theappropriate permissions, status, etc., the resource manager candetermine whether there are adequate resources available to suit theuser's request, and if so can provision the resources or otherwise grantaccess to the corresponding portion of those resources for use by theuser for an amount specified by the request. This amount can include,for example, capacity to process a single request or perform a singletask, a specified period of time, or a recurring/renewable period, amongother such values. If the user does not have a valid account with theprovider, the user account does not enable access to the type ofresources specified in the request, or another such reason is preventingthe user from obtaining access to such resources, a communication can besent to the user to enable the user to create or modify an account, orchange the resources specified in the request, among other such options.

Once the user is authenticated, the account verified, and the resourcesallocated, the user can utilize the allocated resource(s) for thespecified capacity, amount of data transfer, period of time, or othersuch value. In at least some embodiments, a user might provide a sessiontoken or other such credentials with subsequent requests in order toenable those requests to be processed on that user session. The user canreceive a resource identifier, specific address, or other suchinformation that can enable the client device 102 to communicate with anallocated resource without having to communicate with the resourcemanager 110, at least until such time as a relevant aspect of the useraccount changes, the user is no longer granted access to the resource,or another such aspect changes.

The resource manager 110 (or another such system or service) in thisexample can also function as a virtual layer of hardware and softwarecomponents that handles control functions in addition to managementactions, as may include provisioning, scaling, replication, etc. Theresource manager can utilize dedicated APIs in the interface layer 108,where each API can be provided to receive requests for at least onespecific action to be performed with respect to the data environment,such as to provision, scale, clone, or hibernate an instance. Uponreceiving a request to one of the APIs, a Web services portion of theinterface layer can parse or otherwise analyze the request to determinethe steps or actions needed to act on or process the call. For example,a Web service call might be received that includes a request to create adata repository.

An interface layer 108 in at least one embodiment includes a scalableset of customer-facing servers that can provide the various APIs andreturn the appropriate responses based on the API specifications. Theinterface layer also can include at least one API service layer that inone embodiment consists of stateless, replicated servers which processthe externally-facing customer APIs. The interface layer can beresponsible for Web service front end features such as authenticatingcustomers based on credentials, authorizing the customer, throttlingcustomer requests to the API servers, validating user input, andmarshalling or unmarshalling requests and responses. The API layer alsocan be responsible for reading and writing database configuration datato/from the administration data store, in response to the API calls. Inmany embodiments, the Web services layer and/or API service layer willbe the only externally visible component, or the only component that isvisible to, and accessible by, customers of the control service. Theservers of the Web services layer can be stateless and scaledhorizontally as known in the art. API servers, as well as the persistentdata store, can be spread across multiple data centers in a region, forexample, such that the servers are resilient to single data centerfailures.

As mentioned, such an environment enables organizations to obtain andconfigure computing resources over a network such as the Internet toperform various types of computing operations (e.g., execute code,including threads, programs, software, routines, subroutines, processes,etc.). Thus, developers can quickly purchase or otherwise acquire adesired amount of computing resources without having to worry aboutacquiring physical machines. Such computing resources are typicallypurchased in the form of virtual computing resources, or virtual machineinstances. These instances of virtual machines, which are hosted onphysical computing devices with their own operating systems and othersoftware components, can be utilized in the same manner as physicalcomputers.

In many such environments, resource instances such as virtual machinesare allocated to a customer (or other authorized user) for a period oftime in order to process tasks on behalf of that customer. In manycases, however, a customer may not have a steady flow of work such thatthe customer must maintain a sufficient number of virtual machines tohandle peak periods of work but will often have less than this amount ofwork. This can result in underutilization and unneeded expense for boththe customer and the resource provider. Approaches in accordance withvarious embodiments can instead allocate resource instances on a task orevent basis to execute a function. A resource instance can be allocatedto run a function in response to a customer request or event, and oncethe function has completed that instance can either be made availablefor processing a different event or destroyed, among other such options.In either case, the customer will not be charged for more processing bythe instance than was needed to run the function.

FIG. 2 illustrates components of an example environment 200 that can beused to implement such functionality. The functionality can be offeredas a service, such as a Web service, in at least some embodiments,wherein a client device 202 associated with a customer can submitrequests or event information over at least one network 204 to theresource environment (i.e., a resource provider environment, serviceprovider environment, or other shared resource or multi-tenantenvironment). The events or requests can each be associated withspecific code to be executed in the resource environment. This code canbe registered with the system, and will be referred to herein as aregistered function, which can be owned by a respective customer oravailable for use by multiple customers, among other such options. Thecompute service offered by the resource environment can be referred toas a “serverless” compute service that can allocate virtual resources toexecute registered functions in response to customer events andautomatically manage the underlying compute resources. The functions canbe executed on high-availability compute infrastructure that can performthe administration of the compute resources, including server andoperating system maintenance, capacity provisioning and automaticscaling, code and security patch deployment, and code monitoring andlogging. Customers supply the code to be executed and can be billedbased on the actual amount of compute time utilized on behalf of thosecustomers.

In some embodiments, a registered function can include the customer codeas well as associated configuration information. The configurationinformation can include, for example, the function name and resourcerequirements. Registered functions can be considered to be “stateless,”in that they do not rely on state contained in the infrastructure andconsidered to be lacking affinity to the underlying infrastructure(e.g., the functions are not installed or otherwise tied to theoperating system running in the virtual machine), so that the resourcemanagers can rapidly launch as many copies of the function as is neededto scale to the rate of incoming events. A customer providing the codefor a function can specify various configuration parameters, such as thememory, timeout period, and access rules, among other such aspects. Thecustomer in some embodiments can also specify resources that are able totrigger execution of a registered function by a resource instance. Theseresources can include, for example, data buckets, database tables, ordata streams, among other such options. The resource manager can invokethe code only when needed and automatically scale to support the rate ofincoming requests without requiring configuration or management onbehalf of the customer. A function can be executed by an allocatedresource instance within milliseconds of an event in at least someembodiments, and since the service scales automatically the performancewill remain consistently high as the frequency of events increases.Further, since the code is stateless the service can initialize as manyresource instances as needed without lengthy deployment andconfiguration delays.

Routing information for customer requests or events to execute on avirtual compute fleet (e.g., a group of virtual machine instances thatmay be used to service such requests) based on the frequency ofexecution of the user code enables high frequency user code to achievehigh distribution, which can be good for fault tolerance, and enableslow frequency user code to achieve high consolidation, which can be goodfor cost reduction.

An environment such as that described with respect to FIG. 2 canfacilitate the handling of requests to execute user code on a virtualcompute fleet by utilizing the containers created on the virtual machineinstances as compute capacity. Information for a request or event can bereceived to a load balancer 208 that can determine an appropriateresource fleet 210, 212 to which to direct the information. As will bediscussed in more detail later herein, the decision can be based uponvarious types of information, as may include the context associated withthe type of event or request. Upon receiving a request to execute usercode on a selected virtual compute fleet 210, 212, a frontend service214, 222 associated with the virtual compute fleet can provide theinformation to an instance manager, which can direct the information toa virtual machine (VM) instance 218, 220, 226, 228 where a container onthe instance can provide an execution environment for the registeredfunction.

The client device 202 may utilize one or more user interfaces,command-line interfaces (CLIs), application programming interfaces(APIs), and/or other programmatic interfaces for generating anduploading customer code, invoking the customer code (e.g., submitting arequest to execute the code on the virtual compute system), schedulingevent-based jobs or timed jobs, tracking the customer code, and/orviewing other logging or monitoring information related to theirrequests and/or customer code. Although one or more embodiments may bedescribed herein as using a user interface, it should be appreciatedthat such embodiments may, additionally or alternatively, use any CLIs,APIs, or other programmatic interfaces.

In the example of FIG. 2, the resource environment 206 is illustrated asbeing connected to at least one network 204. In some embodiments, any ofthe components within the recourse environment can communicate withother components (e.g., client computing devices 202 and auxiliaryservices 230, which may include monitoring/logging/billing services,storage service, an instance provisioning service, and/or other servicesthat may communicate with components or services of the resourceenvironment 206. In other embodiments, only certain components such asthe load balancer 208 and/or the frontends 214, 222 may be connected tothe network 204, and other components of the virtual resource service(i.e., components of the resource fleets) may communicate with othercomponents of the resource environment 206 via the load balancer 208and/or the frontends 214, 222.

Customer may use the resource fleets 210, 212 to execute user codethereon. For example, a customer may wish to run a piece of code inconnection with a web or mobile application that the customer hasdeveloped. One way of running the code would be to acquire virtualmachine instances from service providers who provide infrastructure as aservice, configure the virtual machine instances to suit the customer'sneeds, and use the configured virtual machine instances to run the code.Alternatively, the customer may send the resource service a codeexecution request. The resource service can handle the acquisition andconfiguration of compute capacity (e.g., containers, instances, etc.,which are described in greater detail below) based on the code executionrequest, and execute the code using the compute capacity. The allocationmay automatically scale up and down based on the volume, therebyrelieving the customer from the burden of having to worry aboutover-utilization (e.g., acquiring too little computing resources andsuffering performance issues) or under-utilization (e.g., acquiring morecomputing resources than necessary to run the codes, and thusoverpaying).

In the configuration depicted in FIG. 2, a first resource fleet 210includes a frontend 214, an instance manager 216 (later referred toherein as a worker manager), and virtual machine instances 218, 220.Similarly, other resource fleets 212 can also include a frontend 222, aninstance manager 224, and virtual machine instances 226, 228, and therecan be any appropriate number of resource fleets and any appropriatenumber of instances in each resource fleet. The environment can includelow and high frequency fleets as well in at least some embodiments, asmay serve different types of requests or requests for different types ofcustomers. The fleets can also include any number of worker managers,and in some embodiments the frontend and the worker manager can beresident on a single virtual machine instance.

In some embodiments, the load balancer 208 serves as a front door to allthe other services provided by the virtual compute system. The loadbalancer 208 processes requests to execute user code on the virtualcompute system and handles the first level of load balancing across thefrontends 214, 222. For example, the load balancer 208 may distributethe requests among the frontends 214, 222 (e.g., based on the individualcapacity of the frontends). The requests can be distributed evenlyacross the frontends or distributed based on the available capacity onthe respective fleets, among other such options.

Customer code as used herein may refer to any program code (e.g., aprogram, routine, subroutine, thread, etc.) written in a programlanguage. Such customer code may be executed to achieve a specific task,for example, in connection with a particular web application or mobileapplication developed by the user. For example, the customer code may bewritten in JavaScript (node.js), Java, Python, and/or Ruby. The requestmay include the customer code (or the location thereof) and one or morearguments to be used for executing the customer code. For example, thecustomer may provide the customer code along with the request to executethe customer code. In another example, the request may identify apreviously uploaded program code (e.g., using the API for uploading thecode) by its name or its unique ID. In yet another example, the code maybe included in the request as well as uploaded in a separate location(e.g., the external storage service or a storage system internal to theresource environment 206) prior to the request is received by the loadbalancer 208. The virtual compute system may vary its code executionstrategy based on where the code is available at the time the request isprocessed.

In some embodiments, the frontend 214 for a fleet can determine that therequests are properly authorized. For example, the frontend 214 maydetermine whether the user associated with the request is authorized toaccess the customer code specified in the request. The frontend 214 mayreceive the request to execute such customer code in response toHypertext Transfer Protocol Secure (HTTPS) requests from a customer, oruser associated with that customer. Also, any information (e.g., headersand parameters) included in the HTTPS request may also be processed andutilized when executing the customer code. As discussed above, any otherprotocols, including, for example, HTTP, MQTT, and CoAP, may be used totransfer the message containing the code execution request to thefrontend 214. The frontend 214 may also receive the request to executesuch customer code when an event is detected, such as an event that thecustomer has registered to trigger automatic request generation. Forexample, the customer may have registered the customer code with anauxiliary service 230 and specified that whenever a particular eventoccurs (e.g., a new file is uploaded), the request to execute thecustomer code is sent to the frontend 214. Alternatively, the customermay have registered a timed job (e.g., execute the user code every 24hours). In such an example, when the scheduled time arrives for thetimed job, the request to execute the customer code may be sent to thefrontend 214. In yet another example, the frontend 214 may have a queueof incoming code execution requests, and when the batch job for acustomer is removed from the virtual compute system's work queue, thefrontend 214 may process the customer request. In yet another example,the request may originate from another component within the resourceenvironment 206 or other servers or services not illustrated in FIG. 2.

A customer request may specify one or more third-party libraries(including native libraries) to be used along with the customer code. Inone embodiment, the customer request is a ZIP file containing thecustomer code and any libraries (and/or identifications of storagelocations thereof) that are to be used in connection with executing thecustomer code. In some embodiments, the customer request includesmetadata that indicates the program code to be executed, the language inwhich the program code is written, the customer associated with therequest, and/or the computing resources (e.g., memory, etc.) to bereserved for executing the program code. For example, the program codemay be provided with the request, previously uploaded by the customer,provided by the virtual compute system (e.g., standard routines), and/orprovided by third parties. In some embodiments, such resource-levelconstraints (e.g., how much memory is to be allocated for executing aparticular user code) are specified for the particular customer code,and may not vary over each execution of the customer code. In suchcases, the virtual compute system may have access to such resource-levelconstraints before each individual request is received, and theindividual requests may not specify such resource-level constraints. Insome embodiments, the customer request may specify other constraintssuch as permission data that indicates what kind of permissions that therequest has to execute the user code. Such permission data may be usedby the virtual compute system to access private resources (e.g., on aprivate network).

In some embodiments, the customer request may specify the behavior thatshould be adopted for handling the customer request. In suchembodiments, the customer request may include an indicator for enablingone or more execution modes in which the customer code associated withthe customer request is to be executed. For example, the request mayinclude a flag or a header for indicating whether the customer codeshould be executed in a debug mode in which the debugging and/or loggingoutput that may be generated in connection with the execution of thecustomer code is provided back to the customer (e.g., via a console userinterface). In such an example, the virtual compute system 110 mayinspect the request and look for the flag or the header, and if it ispresent, the virtual compute system may modify the behavior (e.g.,logging facilities) of the container in which the customer code isexecuted, and cause the output data to be provided back to the customer.In some embodiments, the behavior/mode indicators are added to therequest by the user interface provided to the customer by the virtualcompute system. Other features such as source code profiling, remotedebugging, etc. may also be enabled or disabled based on the indicationprovided in the request.

The frontend 214 can receive requests to execute customer code on thevirtual compute system that have been processed by the load balancer208. The frontend 214 can request the instance manager 216 associatedwith the frontend 214 of the particular fleet 210 to find computecapacity in one of the virtual machine instances 218, 220 managed by theinstance manager 216. The frontend 214 may include a usage data managerfor determining the usage status (e.g., indicating how frequently theuser code is executed) of a particular customer code, and a customercode execution manager for facilitating the execution of customer codeon one of the virtual machine instances managed by the worker manager.The instance manager 216 manages the virtual machine instances in therespective fleet. After a request has been successfully processed by theload balancer 208 and the frontend 214, the instance manager 216 findscapacity to service the request to execute customer code on the virtualcompute system. For example, if there exists a container on a particularvirtual machine instance that has the user code loaded thereon, theinstance manager 216 may assign the container to the request and causethe request to be executed in the container. Alternatively, if thecustomer code is available in the local cache of one of the virtualmachine instances, the instance manager 216 may create a new containeron such an instance, assign the container to the request, and cause thecustomer code to be loaded and executed in the container. Otherwise, theinstance manager 216 may assign a new virtual machine instance to thecustomer associated with the request from the pool of pre-initializedand pre-configured virtual machine instances, download the customer codeonto a container created on the virtual machine instance, and cause thecustomer code to be executed in the container.

In some embodiments, the virtual compute system is adapted to beginexecution of the customer code shortly after it is received (e.g., bythe load balancer 208 or frontend 214). A time period can be determinedas the difference in time between initiating execution of the customercode (e.g., in a container on a virtual machine instance associated withthe customer) and receiving a request to execute the customer code(e.g., received by a frontend). The virtual compute system can beadapted to begin execution of the customer code within a time periodthat is less than a predetermined duration. The customer code may bedownloaded from an auxiliary service 230. The data may comprise usercode uploaded by one or more customers, metadata associated with suchcustomer code, or any other data utilized by the virtual compute systemto perform one or more techniques described herein. Although only thestorage service is illustrated in the example of FIG. 2, the resourceenvironment 206 may include other levels of storage systems from whichthe customer code may be downloaded. For example, each instance may haveone or more storage systems either physically (e.g., a local storageresident on the physical computing system on which the instance isrunning) or logically (e.g., a network-attached storage system innetwork communication with the instance and provided within or outsideof the virtual compute system) associated with the instance on which thecontainer is created. Alternatively, the code may be downloaded from aweb-based data store provided by the storage service.

In some embodiments, once a virtual machine instance has been assignedto a particular customer, the same virtual machine instance cannot beused to service requests of any other customer. This provides securitybenefits to customers by preventing possible co-mingling of userresources. Alternatively, in some embodiments, multiple containersbelonging to different customers (or assigned to requests associatedwith different customers) may co-exist on a single virtual machineinstance. Such an approach may improve utilization of the availablecompute capacity. Although the virtual machine instances are describedhere as being assigned to a particular customer, in some embodiments theinstances may be assigned to a group of customers, such that an instanceis tied to the group of customers and any member of the group canutilize resources on the instance. For example, the customers in thesame group may belong to the same security group (e.g., based on theirsecurity credentials) such that executing one member's code in acontainer on a particular instance after another member's code has beenexecuted in another container on the same instance does not posesecurity risks. Similarly, the instance manager 216 may assign theinstances and the containers according to one or more policies thatdictate which requests can be executed in which containers and whichinstances can be assigned to which customers. An example policy mayspecify that instances are assigned to collections of customers whoshare the same account (e.g., account for accessing the servicesprovided by the virtual compute system). In some embodiments, therequests associated with the same customer group may share the samecontainers (e.g., if the customer code associated therewith areidentical). In some embodiments, a request does not differentiatebetween the different customers of the group and simply indicates thegroup to which the customers associated with the requests belong. Insome embodiments, the virtual compute system may maintain a separatecache in which customer code is stored to serve as an intermediate levelof caching system between the local cache of the virtual machineinstances and a web-based network storage (e.g., accessible via thenetwork 140).

The instance manager 216 may also manage creation, preparation, andconfiguration of containers within virtual machine instances. Containerscan be logical units within a virtual machine instance and utilizeresources of the virtual machine instances to execute customer code.Based on configuration information associated with a request to executecustomer code, such a container manager can create containers inside avirtual machine instance. In one embodiment, such containers areimplemented as Linux containers.

After the customer code has been executed, the instance manager 216 maytear down the container used to execute the user code to free up theresources it occupied to be used for other containers in the instance.Alternatively, the instance manager 216 may keep the container runningto use it to service additional requests from the same customer. Forexample, if another request associated with the same customer code thathas already been loaded in the container, the request can be assigned tothe same container, thereby eliminating the delay associated withcreating a new container and loading the customer code in the container.In some embodiments, the instance manager 216 may tear down the instancein which the container used to execute the customer code was created.Alternatively, the instance manager 216 may keep the instance running touse the instance to service additional requests from the same customer.The determination of whether to keep the container and/or the instancerunning after the user code is done executing may be based on athreshold time, the type of the user, average request volume of theuser, and/or other operating conditions.

In some embodiments, the virtual compute system may provide data to oneor more of the auxiliary services 230 as the system services incomingcode execution requests. For example, the virtual compute system maycommunicate with the monitoring/logging/billing services, which mayinclude: a monitoring service for managing monitoring informationreceived from the virtual compute system, such as statuses of containersand instances on the virtual compute system; a logging service formanaging logging information received from the virtual compute system,such as activities performed by containers and instances on the virtualcompute system; and a billing service for generating billing informationassociated with executing customer code on the virtual compute system(e.g., based on the monitoring information and/or the logginginformation managed by the monitoring service and the logging service).In addition to the system-level activities that may be performed by themonitoring/logging/billing services (e.g., on behalf of the virtualcompute system) as described above, the monitoring/logging/billingservices may provide application-level services on behalf of thecustomer code executed on the virtual compute system. For example, themonitoring/logging/billing services may monitor and/or log variousinputs, outputs, or other data and parameters on behalf of the customercode being executed on the virtual compute system. Although shown as asingle block, the monitoring, logging, and billing services may beprovided as separate services.

In some embodiments, the instance manager 216 may perform health checkson the instances and containers managed by the instance manager (e.g.,an “active pool” of virtual machine instances managed by the instancemanager and currently assigned to one or more customers). For example,the health checks performed by the instance manager 216 may includedetermining whether the instances and the containers managed by theinstance manager have any issues of (1) misconfigured networking and/orstartup configuration, (2) exhausted memory, (3) corrupted file system,(4) incompatible kernel, and/or any other problems that may impair theperformance of the instances and the containers. In one embodiment, theinstance manager 216 performs the health checks periodically. In someembodiments, the frequency of the health checks may be adjustedautomatically based on the result of the health checks. In otherembodiments, the frequency of the health checks may be adjusted based oncustomer requests. In some embodiments, the instance manager 216 mayperform similar health checks on the instances and/or containers in thepool of pre-warmed virtual machine instances that are not yet assignedto any customer but ready to service incoming requests. The instancesand/or the containers in such a warming pool may be managed eithertogether with those instances and containers in the active pool orseparately. In some embodiments, in the case where the health of theinstances and/or the containers in the warming pool is managedseparately from the active pool, a separate warming pool manager thatmanages the warming pool may perform the health checks described aboveon the instances and/or the containers in the warming pool.

The virtual machine instances can be logical in nature and implementedby a single or multiple physical computing devices. At least some of thevirtual machine instances may be provisioned to provide a variety ofdifferent desired conditions depending on the needs of the user.Examples of the types of desired conditions include, but are not limitedto: particular operating systems, particular language runtimes, andparticular libraries that may be utilized by the user code.Additionally, one or more virtual machine instances may be provisionedgenerically when a desired operating condition is not specified or isotherwise not available. One skilled in the relevant art will appreciatethat the virtual compute system is logical in nature and can encompassphysical computing devices from various geographic regions.

The frontend 214, 222 can route code-processing requests according to amethod that is different than the method used by the load balancer 208to route requests among the frontends. For example, a frontend 214 canroute the requests to the specific instance manager based on thecustomer code and/or based on the customer associated with the customercode. In some embodiments, the routing is determined based on aconsistent-hashing scheme in which one or more parameters associatedwith the request (e.g., customer ID, customer code ID, etc.) are hashedaccording to a hash function and the request is sent to one of theinstance managers that has previously been assigned to the sections of ahash ring (e.g., containing a plurality of hash values) that correspondsto the resulting hash value. For example, the instance managers canoccupy one or more sections of the hash ring, and the requests can bemapped to those same hash values. In some embodiments, the hash valuesmay be integer values, and each instance manager may be associated withone or more integer values. The one or more integer values associatedwith a particular instance manager may be determined based on one ormore parameters associated with the instance manager (e.g., IP address,instance ID, etc.). In some embodiments, the request may be sent to theinstance manager whose associated integer values are closest to, but notlarger than, the hash value calculated for that request (e.g., usingmodulo arithmetic).

When the frontends determine that one or more instance managers havebecome unavailable, the frontends can associate the hash valuespreviously associated with the one or more instance managers that havebecome unavailable with one or more available instance managers inanother fleet. Similarly, when a new instance manager is added to afleet, the new instance manager may take a share of the hash valuesassociated with the existing instance managers. For example, the newinstance manager may be assigned one or more sections of the hash ringthat were previously assigned to the existing instance managers.

As mentioned, resource capacity can be allocated as needed to executecode or perform specific tasks, which can be allocated in response tovarious events. The events can include any appropriate types of events,as may be permitted by a service provider or allowed through variousrules or policies, among other such options. These can include, forexample, modifications to data buckets or updates to data tables, amongother such options. The dynamic allocation of such capacity enablesservice owners to get out of the business of provisioning and managingthe underlying hardware for executing code. For flexibility andefficiency in resource management, such a platform or service might notmake any guarantees with respect to reusing the same containers orresource instances for running a specific instance of code, such as aregistered function, for all incoming requests.

As mentioned, in order to process various types of events a resourceinstance for a registered function may require access to various otherresources, data sources, or other relevant systems or functionality in(or outside) a resource allocation environment. In some embodiments, afunction can be configured with a specified role or identity, which willhave various associated permissions and privileges. A registeredfunction can be associated with a determined role, and when a resourceinstance is allocated for the registered function, the resource instancecan be provided with an access token, or other appropriate securitycredential, which can provide the access needed for that function. Asillustrated in the example 200 of FIG. 2, the token can be provided by atoken service 232, which can be internal or external to the resourceenvironment 206, and may managed by the resource provider or a thirdparty in various embodiments. The token service can store informationabout various types of roles and access in a credential repository 234,or other appropriate location, and in response to a request for anaccess token for a registered function, can determine the appropriaterole and permissions and provide a corresponding access token to beprovided to the allocated resource instance. The frontend 214 orinstance manager 216 for a relevant resource fleet 210 can cause theconfigured role to be bound to the relevant host(s) when an instance ofa registered function is created on that host. The role can be bound asan instance profile or other such mechanism. Once the role is bound, theresource instance can assume the bound identity for accessing variousresources or dependencies, as may include various data sources, internalor external resource, or network functionality, among other suchoptions. The resource instance can thus obtain the temporary credentialsneeded to execute the registered function and process the event.

Using such an identity management model, the function instancestriggered by any event could thus have access to credentials with thesame privileges. For example, a registered function can have inputaccess to a specified data bucket specified in the triggering event andwrite access to a corresponding database table. The assigned identityrole for this function could then allow any function instance to readfrom any available bucket from that data source and write into anyavailable table in the relevant database. A vulnerability present in theregistered lambda function (i.e., an extensible markup language (XML)external entity resolution) could allow a producer of an event to hijackthe credentials for the registered function, such as by using an XMLexternal entity attack and retrieving the credentials from a localmetadata endpoint for the data source. The security breach might thenspread across the buckets of all function owners as well as allavailable tables in the database.

Accordingly, approaches in accordance with various embodiments attemptto enhance security and limit the impact of any vulnerabilities bycreating and delivering temporary credentials for each event, or type ofevent, that can act as a trigger for a registered function. While theregistered function might be associated with a role having a broader setof permissions, the temporary credentials derived therefrom can haveprivileges restricted to those required to process the triggering event.A function owner can define one or more parameterized access policiesfor his or her registered function(s) that can be based at least in partupon the types of triggering events for that registered function. Theresource allocation service can use these parameterized access policiesto generate policy instances corresponding to each event, and use thepolicy instances for creating and delivering the temporary credentialswith each event.

FIG. 3 illustrates an example environment 300 that can be used toimplement at least some of this functionality. In this example,information for customer requests or events can be directed to aresource fleet 302. The information can be directed using a loadbalancer and/or interface layer as discussed previously as part of aresource allocation environment. In this example the resource instanceswill be referred to as “workers,” which in various embodiments can referto the virtual machine instances 218, 220, 226, 228 described withrespect to FIG. 2. It should be understood, however, that various othertypes of resource instances can be utilized as workers as well withinthe scope of the various embodiments.

As described, the frontend 304 may receive an event notification,customer request, or other event information that indicates an event hasoccurred for which a registered function should be utilized orprocessing. In this example, the frontend 304 can determine theappropriate registered function and place the event information in anevent queue 320. In other embodiments the event information might beplaced into the event queue before determining the registered function,or the event information might specify the registered function, amongother such options. Further, in this event the frontend 304 and/or aworker manager of the frontend can place the event information in theevent queue 320, while in other embodiments other worker managers 314,316 might receive the information and place the information in the same,or a different queue, among other such options. The frontend, workermanager, or a separate queue manager can determine that a worker 318 isnow available to process the event information using the respectiveregistered function. This can include, for example, determining that anew instance should be initialized to process the event as well asallocating an existing instance, etc. The respective worker manager 314can then allocate the relevant worker 318 for the event, pull the eventinformation from the event queue 320, and provide the information to theallocated worker 318 for processing using the registered function.

At some subsequent point, the allocated worker 314 will completeprocessing for the event. This can occur for a number of differentreasons as discussed elsewhere herein. The allocated instance can returna result of the processing that can be received back to the workermanager 314 and/or the frontend 304. In some embodiments the result willgo to the worker manager, so the manager knows the instance is availablefor processing another event, and then can go to the frontend, so thefrontend can provide any appropriate response or take anotherappropriate action.

In order to process the event, a worker 318 will have to be allocatedfor the relevant registered function. As mentioned, the worker will needto obtain the appropriate access credential(s) for the registeredfunction, as may be determined by a role bound to that instance for theregistered function. As mentioned, the role can provide various types ofaccess for a determined period of time, such as fifteen minutes in someembodiments, although other lengths of time can be specified as well.Since there can be various types of triggering events for a function,the role can enable access to all relevant data for any of those eventsfor the entire lifecycle of the function. As mentioned, however,granting all the access provided under the role can enable anyvulnerability in the registered function to access data outside thescope of the registered function, and potentially exfiltrate thecredentials outside of the function for various other purposes. As anexample, various parsers might be used to ingest and process differenttypes of documents, and without a security review of those parsers thereis potential that parsing of an untrusted document could expose accessto the function credentials.

Accordingly, approaches in accordance with various embodiments canprovide event-specific credentials that are derived from an identityrole bound, or otherwise associated, to the registered function for aresource instance. The necessary privileges can be provided under therole, but the restricted credentials can prevent access outside thatneeded to process the event. A system, component, or service such as acredential manager 308 can create a temporary token that has access onlyto those input and output sources required for processing the event, andcan cause that token to be passed to the relevant worker 318 allocatedfor the event. The event-specific credential can be bound to theresource instance allocated in response to a specific event, and thepermissions granted under the temporary credential determined based uponthe specific event. The credential manager 308 can generate a temporarytoken that is event-specific, and can cause that temporary token to alsobe stored to a credential repository 312 or other appropriate cache suchthat the credentials can be passed to any other resource instanceallocated for a registered function in response to the same type ofevent.

The event-specific credential can be generated according to the securitytoken bound to the registered function and received from the tokenservice in at least some embodiments. In order to determine which subsetof permissions to be granted from the token, a function owner can defineone or more relevant access policies that can be stored to a relevantpolicy data store 310 or other accessible location. A policy manager306, or other such system or service, can work with the credentialmanager 308 to determine the appropriate policy for an event, which thecredential manager 308 can then use to determine the appropriatepermissions and generate the temporary credential to be provided to theallocated worker 318. The policy manager in some embodiments canmaintain a mapping between the policies and events, in order to derivethe appropriate temporary credentials from the function role. It shouldbe understood that in at least some embodiments the policy manager 306and/or credential manager 308 could be implemented in the frontend 304,an event router, or another such component discussed or suggestedherein.

In at least some embodiments a function owner can provide a templatepolicy which includes variables whose values will be specific to anevent. This can include, for example, identifiers for the input andoutput data sources to which access can be granted, as well as the typeof access and other such information. For each event, the availableaccess for the relevant role can be determined, and the variable valuesfor the event inserted into the template policy. The policy manager canthen ensure that the permissions per the policy are contained within theoverall permissions of the role, and if so can generate the temporarycredential to be provided to the allocated worker. In some embodimentsthe credential manager can generate the event-specific credentials,while in other embodiments the credential manager can submit a requestto the token service to receive an event-specific token, among othersuch options. As mentioned, the credential manager 308 can cache areceived event-specific token in a local credential cache 312 to be usedfor other similar events for the registered function over the lifetimeof the temporary credential.

In some embodiments the frontend 304 or worker manager 314 will performa lookup to determine the relevant role for a function before performingthe worker allocation. The frontend or worker manager can also, directlyor via a policy manager 306, determine the appropriate template policymapped to the specific event. The frontend or worker manager can then,directly or via the credential manager, begin filling in the templateusing the event-specific values. As an example, a registered functionmight be triggered by a notification event on a storage service, and theevent can be received from any bucket on that storage service. Theoutput could then be written to a database table named:$(bucket-name)-db. An example, conventional access policy for such afunction is given by:

{ “Statement”: [ { “Action”: [ “db1:GetObject” ], “Effect”: “Allow”,“Resource”: “*” }, { “Action”: [ “db2:UpdateItem” ], “Effect”: “Allow”,“Resource”: “*” } ] }

With the proposed instance, the function can define the followingparameterized access policy for its function:

{ “Statement”: [ { “Action”: [ “db1:GetObject” ], “Effect”: “Allow”,“Resource”: “$(event.bucket.arn)/$(event.object.key)” }, { “Action”: [“db2:UpdateItem” ], “Effect”: “Allow”, “Resource”: “arn:db2:us-east-1:12345:table/$(event.bucket.arn)-db” } ] }

Having this parameterized access policy, if the resource allocationservice is delivering a notification event on bucket of: test-data andS3 object of: sample-001, then the service can use an access policy suchas the following for generating the events associated temporarycredentials:

{ “Statement”: [ { “Action”: [ “db1:GetObject” ], “Effect”: “Allow”,“Resource”: arn:db1:::test-data/sample-001” }, { “Action”: [“db2:UpdateItem” ], “Effect”: “Allow”, “Resource”:“arn:db2:us-east-1:12345:table/test-data-db” } ] }

As illustrated, the respective values can be filled into the policytemplate with the specific buckets, tables, or other sources specifiedin the policy. The policy can then be instantiated into a specificstring, such that the policy does not have any value to other parties.The variables in the template policy are thus filled with the respectivevalues from the triggering event. The event-specific policy can then beprocessed with the base credential received for the role to obtain asecond token that has restricted privileges, from the base credentials,specific to the triggering event. The event and the temporaryevent-specific token can then be passed along to the allocated worker.If any of the credentials are leaked or otherwise obtained by anunintended third party, the credentials would only provide access to thespecific input and output sources for the event. The event-specificcredentials can also have a shorter period of time in some embodiments,such as on the order of a couple of minutes at most, which can be muchshorter than the lifetime of the base credentials for the role. This caninclude, for example, periods that start right away but end before thevalid lifetime of the base credential ends, or can include a specifiedperiod of time in the future corresponding to a predicted execution timeof the registered function for the event, among other such options.

FIG. 4 illustrates an example process 400 for processing a registeredfunction for an event using one or more allocated resource instancesthat can be utilized in accordance with various embodiments. It shouldbe understood for this and other processes discussed herein that therecan be additional, alternative, or fewer steps performed in similar oralternative orders, or in parallel, within the scope of the variousembodiments unless otherwise stated. In this example, information for atriggering customer event is received 402 to a resource allocationservice or other appropriate system or offering. The information can bereceived from a customer request or in response to detecting a specifiedtype of event among other such options. A registered function associatedwith that type of event that is to be used to process the event can bedetermined 404. A customer can specify types of functions for types ofevents, can provide guidelines as to which functions to use, or canspecify sources or other criteria for use in determining the appropriateregistered function in accordance with various embodiments. Asmentioned, access credentials for the registered function that arespecific to the event can be determined 406 (i.e., generated or locatedfrom cache) as well. This can include, for example, providing a baseaccess token and an event-specific policy to a token service configuredto provide at least one restricted access credential that is specific tothe event.

In this example, the event information and the event-specific accesscredentials can be placed 408 into an event queue for processing,although in other embodiments the information may be provided directlyto an allocated resource instance, among other such options. Informationfor the corresponding registered function can be included with the eventinformation or associated with the event information in some way, suchthat an appropriate resource instance or worker can be selected toprocess the event. This can include a warmed instance that is alreadyconfigured and available to process that type of event using thecorresponding function, or can involve initializing or reconfiguring anew instance, among other such options. The events can be processed fromthe queue in any appropriate order, such as by using a FIFO or LIFOapproach or selecting based on priority or type, among other suchoptions. At some point it can be determined 410 that there is anavailable resource instance (e.g., virtual machine or container) forprocessing the event information using the registered function. Theinstance can then be allocated 412 for processing the event, and theevent can be processed until processing by that instance has completedand a result of the processing is received 412.

When processing by the allocated resource instance has completed, aresult of the processing can be received 414. Processing may havecompleted when the registered function has been successfully executedand the event processed, or may have completed due to a bug in executionor timeout value being reached, among other such options. Adetermination can be made 416 as to whether the processing wassuccessfully completed. If not, the event data and event-specific accesscredentials (if still valid) can be placed back in the event queue tore-attempt processing. If the processing is determined to have beensuccessfully completed, then the result of the event processing can beprovided 418 to the appropriate destination, such as a device associatedwith a customer or a result data store, among other such options.

FIG. 5 illustrates another example process 500 for determining at leastone event-specific access credential that can be utilized in accordancewith various embodiments. In this example, a triggering customer eventis detected 502 as discussed previously. The registered functionassociated with the customer event can also be determined 504. Anidentity role bound to the registered function can be determined 506.Based at least in part upon the identity role and the event information,a determination can be made 508 as to whether a cached token exists thatis still valid and is specific to the triggering event, or type ofevent, that was detected. If so, that cached token can be passed to theallocated resource instance as discussed later herein. If such a tokenis not cached, or otherwise available, then a template policy for theregistered function can be determined 510. As mentioned, there may beone or more template policies defined for a registered function, and theappropriate template policy might depend at least in part upon the typeof event triggering the allocation. The determined template policy canhave its variables filled 512 using information specific to thetriggering event, as may relate to the input and output data sources,types of network functionality and access (e.g., read/write access oruse of a secure channel), applicable network security groups, and otheraspects discussed and suggested elsewhere herein. In addition tolimiting the types of resources to which the function will have access,an event-specific token can limit the environment in which the functionexecutes, as well as the security settings and network configurationapplied, among other such options. The event-specific token can beobtained 514, or generated, using the event-specific policy and the basecredential for the identity role of the registered function. Anappropriate resource instance (or worker) can be allocated 516, such asby generating a new resource instance or allocating use of an existinginstance for processing the event. The event-specific token, generatedusing the event-specific policy, can be passed 518 to the allocatedinstance with the event information for processing. This can includetransmitting the event-specific token to the instance during theallocation process. In some embodiments, the token can instead be pulledfrom an event queue or data store where the token has been temporarilystored, or can be otherwise be retrieved or obtained using an address oridentifier associated with the event. As mentioned, in at least someembodiments the variables in the template policy are filled with valuesfrom the triggering event. The event-specific policy can then beprocessed with the base credential received for the role to obtain anevent-specific token that has restricted privileges, from the basecredentials, specific to the triggering event. The event and thetemporary event-specific token can then be passed along to the allocatedinstance. The event can then be processed 520 by executing theregistered function on the resource instance using data obtained usingthe event-specific token and then, as appropriate, writing data to alocation accessible using the event-specific token. The event token ifgenerated can also be stored to the token cache for use for subsequentevents occurring over the valid lifetime of the token.

In some embodiments the values for the template policies can be definedby objects or sources other than the event data. For example, a script(e.g., Python or Ruby) could be executed that would define the values,or generate an entire event-specific policy. In some embodiments anotherregistered function can be executed to determine the appropriate values.A customer can have the ability through any of these or other mechanismsto remove or reduce the privileges offered for specific events. Forexample, a script might analyze the data sources needed for an event andthen modify the permissions based upon those data sources. The scriptmight also vary the permissions based upon the type of object beingprocessed, such as for a Word document versus a PDF document. In someembodiments the permissions might vary based upon a determined risklevel or threat assessment, etc.

FIG. 6 illustrates a set of basic components of an example computingdevice 1000 that can be utilized to implement aspects of the variousembodiments. In this example, the device includes at least one processor602 for executing instructions that can be stored in a memory device orelement 604. As would be apparent to one of ordinary skill in the art,the device can include many types of memory, data storage orcomputer-readable media, such as a first data storage for programinstructions for execution by the at least one processor 602, the sameor separate storage can be used for images or data, a removable memorycan be available for sharing information with other devices, and anynumber of communication approaches can be available for sharing withother devices. The device may include at least one type of displayelement 606, such as a touch screen, electronic ink (e-ink), organiclight emitting diode (OLED) or liquid crystal display (LCD), althoughdevices such as servers might convey information via other means, suchas through a system of lights and data transmissions. The devicetypically will include one or more networking components 608, such as aport, network interface card, or wireless transceiver that enablescommunication over at least one network. The device can include at leastone input device 610 able to receive conventional input from a user.This conventional input can include, for example, a push button, touchpad, touch screen, wheel, joystick, keyboard, mouse, trackball, keypador any other such device or element whereby a user can input a commandto the device. These I/O devices could even be connected by a wirelessinfrared or Bluetooth or other link as well in some embodiments. In someembodiments, however, such a device might not include any buttons at alland might be controlled only through a combination of visual and audiocommands such that a user can control the device without having to be incontact with the device.

As discussed, different approaches can be implemented in variousenvironments in accordance with the described embodiments. As will beappreciated, although a Web-based environment is used for purposes ofexplanation in several examples presented herein, different environmentsmay be used, as appropriate, to implement various embodiments. Thesystem includes an electronic client device, which can include anyappropriate device operable to send and receive requests, messages orinformation over an appropriate network and convey information back to auser of the device. Examples of such client devices include personalcomputers, cell phones, handheld messaging devices, laptop computers,set-top boxes, personal data assistants, electronic book readers and thelike. The network can include any appropriate network, including anintranet, the Internet, a cellular network, a local area network or anyother such network or combination thereof. Components used for such asystem can depend at least in part upon the type of network and/orenvironment selected. Protocols and components for communicating viasuch a network are well known and will not be discussed herein indetail. Communication over the network can be enabled via wired orwireless connections and combinations thereof. In this example, thenetwork includes the Internet, as the environment includes a Web serverfor receiving requests and serving content in response thereto, althoughfor other networks, an alternative device serving a similar purposecould be used, as would be apparent to one of ordinary skill in the art.

The illustrative environment includes at least one application serverand a data store. It should be understood that there can be severalapplication servers, layers or other elements, processes or components,which may be chained or otherwise configured, which can interact toperform tasks such as obtaining data from an appropriate data store. Asused herein, the term “data store” refers to any device or combinationof devices capable of storing, accessing and retrieving data, which mayinclude any combination and number of data servers, databases, datastorage devices and data storage media, in any standard, distributed orclustered environment. The application server can include anyappropriate hardware and software for integrating with the data store asneeded to execute aspects of one or more applications for the clientdevice and handling a majority of the data access and business logic foran application. The application server provides access control servicesin cooperation with the data store and is able to generate content suchas text, graphics, audio and/or video to be transferred to the user,which may be served to the user by the Web server in the form of HTML,XML or another appropriate structured language in this example. Thehandling of all requests and responses, as well as the delivery ofcontent between the client device and the application server, can behandled by the Web server. It should be understood that the Web andapplication servers are not required and are merely example components,as structured code discussed herein can be executed on any appropriatedevice or host machine as discussed elsewhere herein.

The data store can include several separate data tables, databases orother data storage mechanisms and media for storing data relating to aparticular aspect. For example, the data store illustrated includesmechanisms for storing content (e.g., production data) and userinformation, which can be used to serve content for the production side.The data store is also shown to include a mechanism for storing log orsession data. It should be understood that there can be many otheraspects that may need to be stored in the data store, such as page imageinformation and access rights information, which can be stored in any ofthe above listed mechanisms as appropriate or in additional mechanismsin the data store. The data store is operable, through logic associatedtherewith, to receive instructions from the application server andobtain, update or otherwise process data in response thereto. In oneexample, a user might submit a search request for a certain type ofitem. In this case, the data store might access the user information toverify the identity of the user and can access the catalog detailinformation to obtain information about items of that type. Theinformation can then be returned to the user, such as in a resultslisting on a Web page that the user is able to view via a browser on theuser device. Information for a particular item of interest can be viewedin a dedicated page or window of the browser.

Each server typically will include an operating system that providesexecutable program instructions for the general administration andoperation of that server and typically will include computer-readablemedium storing instructions that, when executed by a processor of theserver, allow the server to perform its intended functions. Suitableimplementations for the operating system and general functionality ofthe servers are known or commercially available and are readilyimplemented by persons having ordinary skill in the art, particularly inlight of the disclosure herein.

The environment in one embodiment is a distributed computing environmentutilizing several computer systems and components that areinterconnected via communication links, using one or more computernetworks or direct connections. However, it will be appreciated by thoseof ordinary skill in the art that such a system could operate equallywell in a system having fewer or a greater number of components than areillustrated. Thus, the depiction of the systems herein should be takenas being illustrative in nature and not limiting to the scope of thedisclosure.

The various embodiments can be further implemented in a wide variety ofoperating environments, which in some cases can include one or more usercomputers or computing devices which can be used to operate any of anumber of applications. User or client devices can include any of anumber of general purpose personal computers, such as desktop ornotebook computers running a standard operating system, as well ascellular, wireless and handheld devices running mobile software andcapable of supporting a number of networking and messaging protocols.Devices capable of generating events or requests can also includewearable computers (e.g., smart watches or glasses), VR headsets,Internet of Things (IoT) devices, voice command recognition systems, andthe like. Such a system can also include a number of workstationsrunning any of a variety of commercially-available operating systems andother known applications for purposes such as development and databasemanagement. These devices can also include other electronic devices,such as dummy terminals, thin-clients, gaming systems and other devicescapable of communicating via a network.

Most embodiments utilize at least one network that would be familiar tothose skilled in the art for supporting communications using any of avariety of commercially-available protocols, such as TCP/IP, FTP, UPnP,NFS, and CIFS. The network can be, for example, a local area network, awide-area network, a virtual private network, the Internet, an intranet,an extranet, a public switched telephone network, an infrared network, awireless network and any combination thereof.

In embodiments utilizing a Web server, the Web server can run any of avariety of server or mid-tier applications, including HTTP servers, FTPservers, CGI servers, data servers, Java servers and businessapplication servers. The server(s) may also be capable of executingprograms or scripts in response requests from user devices, such as byexecuting one or more Web applications that may be implemented as one ormore scripts or programs written in any programming language, such asJava®, C, C # or C++ or any scripting language, such as Perl, Python orTCL, as well as combinations thereof. The server(s) may also includedatabase servers, including without limitation those commerciallyavailable from Oracle®, Microsoft®, Sybase® and IBM® as well asopen-source servers such as MySQL, Postgres, SQLite, MongoDB, and anyother server capable of storing, retrieving and accessing structured orunstructured data. Database servers may include table-based servers,document-based servers, unstructured servers, relational servers,non-relational servers or combinations of these and/or other databaseservers.

The environment can include a variety of data stores and other memoryand storage media as discussed above. These can reside in a variety oflocations, such as on a storage medium local to (and/or resident in) oneor more of the computers or remote from any or all of the computersacross the network. In a particular set of embodiments, the informationmay reside in a storage-area network (SAN) familiar to those skilled inthe art. Similarly, any necessary files for performing the functionsattributed to the computers, servers or other network devices may bestored locally and/or remotely, as appropriate. Where a system includescomputerized devices, each such device can include hardware elementsthat may be electrically coupled via a bus, the elements including, forexample, at least one central processing unit (CPU), at least one inputdevice (e.g., a mouse, keyboard, controller, touch-sensitive displayelement or keypad) and at least one output device (e.g., a displaydevice, printer or speaker). Such a system may also include one or morestorage devices, such as disk drives, optical storage devices andsolid-state storage devices such as random access memory (RAM) orread-only memory (ROM), as well as removable media devices, memorycards, flash cards, etc.

Such devices can also include a computer-readable storage media reader,a communications device (e.g., a modem, a network card (wireless orwired), an infrared communication device) and working memory asdescribed above. The computer-readable storage media reader can beconnected with, or configured to receive, a computer-readable storagemedium representing remote, local, fixed and/or removable storagedevices as well as storage media for temporarily and/or more permanentlycontaining, storing, transmitting and retrieving computer-readableinformation. The system and various devices also typically will includea number of software applications, modules, services or other elementslocated within at least one working memory device, including anoperating system and application programs such as a client applicationor Web browser. It should be appreciated that alternate embodiments mayhave numerous variations from that described above. For example,customized hardware might also be used and/or particular elements mightbe implemented in hardware, software (including portable software, suchas applets) or both. Further, connection to other computing devices suchas network input/output devices may be employed.

Storage media and other non-transitory computer readable media forcontaining code, or portions of code, can include any appropriate mediaknown or used in the art, such as but not limited to volatile andnon-volatile, removable and non-removable media implemented in anymethod or technology for storage of information such as computerreadable instructions, data structures, program modules or other data,including RAM, ROM, EEPROM, flash memory or other memory technology,CD-ROM, digital versatile disk (DVD) or other optical storage, magneticcassettes, magnetic tape, magnetic disk storage or other magneticstorage devices or any other medium which can be used to store thedesired information and which can be accessed by a system device. Basedon the disclosure and teachings provided herein, a person of ordinaryskill in the art will appreciate other ways and/or methods to implementthe various embodiments.

The specification and drawings are, accordingly, to be regarded in anillustrative rather than a restrictive sense. It will, however, beevident that various modifications and changes may be made thereuntowithout departing from the broader spirit and scope of the invention asset forth in the claims.

What is claimed is:
 1. A computer-implemented method, comprising:detecting a notification event associated with a customer of a resourceprovider environment; determining a registered function corresponding tothe notification event, the registered function including code to beexecuted on behalf of the customer; determining a base credentialassociated with the registered function, the base credential grantingaccess to a plurality of network resources in the resource providerenvironment; determining a template policy associated with theregistered function, the template policy including one or morevariables; causing values for the one or more variables to be insertedinto the template policy to generate an event-specific policy, thevalues being determined based at least in part upon the notificationevent; obtaining an event-specific credential using the event-specificpolicy and the base credential, the event-specific credential granting asubset of permissions granted by the base credential; allocating aresource instance for executing the registered function; causing theresource instance to obtain the event information and the event-specificcredential; and causing the resource instance to process thenotification event at least in part by executing the registered functionusing data obtained via the event-specific credential.
 2. Thecomputer-implemented method of claim 1, further comprising: storing theevent-specific credential to a credential cache, wherein theevent-specific credential is able to be utilized for processing ofsimilar notification events for the customer during a valid lifetime ofthe event-specific credential.
 3. The computer-implemented method ofclaim 1, further comprising: executing at least one customer-providedscript to determine at least one of the values for the one or morevariables.
 4. The computer-implemented method of claim 1, furthercomprising: receiving the base credential from a token service; sendingthe event-specific policy to the token service to be used with the basecredential to generate the event-specific credential; and receiving theevent-specific credential from the token service.
 5. Thecomputer-implemented method of claim 1, further comprising: receivingthe template policy from the customer, enabling the customer todetermine which subset of the permissions, granted under the basecredential for the customer, are granted by the event-specificcredential.
 6. The computer-implemented method of claim 1, wherein theresource instance is a virtual machine or a container executing on thevirtual machine.
 7. A computer-implemented method, comprising: detectingan event associated with a registered function; determining a templatepolicy associated with the registered function; generating anevent-specific policy by filling one or more variables of the templatepolicy, associated with the registered function, with values determinedbased at least in part upon the event; obtaining an event-specificcredential using the event-specific policy and a base credential, thebase credential granting access to a plurality of electronic resourcesassociated with the registered function, the event-specific credentialgranting a subset of permissions granted with respect to the pluralityof electronic resources by the base credential, the subset ofpermissions being relevant to the event; allocating a resource instance,of a plurality of resource instances of a resource allocation service,on behalf of the event; and causing the resource instance to execute theregistered function in order to process the event, the resource instanceobtaining event data for the event and the event-specific credential foraccessing the plurality of electronic resources according to the subsetof permissions.
 8. The computer-implemented method of claim 7, furthercomprising: storing the event-specific credential to a credential cache,wherein the event-specific credential is able to be utilized forprocessing of similar notification events for the customer during avalid lifetime of the event-specific credential.
 9. Thecomputer-implemented method of claim 7, further comprising: executing atleast one customer-provided script to determine at least one of thevalues for the one or more variables.
 10. The computer-implementedmethod of claim 7, further comprising: determining an identity roleassociated with the registered function; and binding the identity roleto the registered function, wherein the base credential is able to beobtained for the registered function with the permissions grantedaccording to the identity role.
 11. The computer-implemented method ofclaim 7, wherein the plurality of electronic resources are configured aspart of a multi-tenant resource environment, the registered functionaccessible to a plurality of customers of the multi-tenant resourceenvironment, the event-specific credential being allocated for anassociated customer of the plurality of customers.
 12. Thecomputer-implemented method of claim 7, further comprising: receivingthe base credential from a token service; sending the event-specificpolicy to the token service to be used with the base credential togenerate the event-specific credential; and receiving the event-specificcredential from the token service.
 13. The computer-implemented methodof claim 7, further comprising: receiving the template policy from thecustomer, enabling the customer to determine which subset of thepermissions, granted under the base credential for the customer, aregranted by the event-specific credential.
 14. A system, comprising: atleast one processor; and memory including instructions that, whenexecuted by the at least one processor, cause the system to: detect anevent associated with a registered function; determine a template policyassociated with the registered function; generate an event-specificpolicy by filling one or more variables of the template policy,associated with the registered function, with values determined based atleast in part upon the event; obtain an event-specific credential usingthe event-specific policy and a base credential, the base credentialgranting access to a plurality of electronic resources associated withthe registered function, the event-specific credential granting a subsetof permissions granted with respect to the plurality of electronicresources by the base credential, the subset of permissions beingrelevant to the event; allocate a resource instance, of a plurality ofresource instances of a resource allocation service, on behalf of theevent; and cause the resource instance to execute the registeredfunction in order to process the event, the resource instance obtainingevent data for the event and the event-specific credential for accessingthe plurality of electronic resources according to the subset ofpermissions.
 15. The computer-implemented method of claim 14, whereinthe instructions when executed further cause the system to: store theevent-specific credential to a credential cache, wherein theevent-specific credential is able to be utilized for processing ofsimilar notification events for the customer during a valid lifetime ofthe event-specific credential.
 16. The computer-implemented method ofclaim 14, wherein the instructions when executed further cause thesystem to: execute at least one customer-provided script to determine atleast one of the values for the one or more variables.
 17. Thecomputer-implemented method of claim 14, wherein the instructions whenexecuted further cause the system to: receive the base credential from atoken service; send the event-specific policy to the token service to beused with the base credential to generate the event-specific credential;and receive the event-specific credential from the token service. 18.The computer-implemented method of claim 14, wherein the instructionswhen executed further cause the system to: receive the template policyfrom the customer, enabling the customer to determine which subset ofthe permissions, granted under the base credential for the customer, aregranted by the event-specific credential.
 19. The computer-implementedmethod of claim 14, wherein the instructions when executed further causethe system to: determine an identity role associated with the registeredfunction; and bind the identity role to the registered function, whereinthe base credential is able to be obtained for the registered functionwith the permissions granted according to the identity role.
 20. Thecomputer-implemented method of claim 14, wherein the plurality ofelectronic resources are configured as part of a multi-tenant resourceenvironment, the registered function accessible to a plurality ofcustomers of the multi-tenant resource environment, the event-specificcredential being allocated for an associated customer of the pluralityof customers.